﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BankingSystem.BLL;
using Model;

namespace BankClas
{
    public partial class Form1 : Form
    {
        private IBank bankServis;
        private String _name;
        private String _secName;
        private String _suname;
        private String _pasport;
        private String _pasportSeach;

        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            bankServis = new Bank();
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            _name = textBox1.Text.ToString();
        }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {
            _secName = textBox2.Text.ToString();
        }

        private void textBox3_TextChanged(object sender, EventArgs e)
        {
            _suname = textBox3.Text.ToString();
        }

        private void textBox4_TextChanged(object sender, EventArgs e)
        {
            _pasport = textBox4.Text.ToString();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            bankServis.CreateClient(new ClientInfo { FistName = _name, LastName = _secName, OrgName = _suname, PassportNumber = _pasport });
            MessageBox.Show(String.Format("клиент {0} создан", _pasport));
        }
    }
}
